Skip to content

[WIP] Sync features with Node 9#24

Open
goto-bus-stop wants to merge 7 commits into
masterfrom
node-9
Open

[WIP] Sync features with Node 9#24
goto-bus-stop wants to merge 7 commits into
masterfrom
node-9

Conversation

@goto-bus-stop

@goto-bus-stop goto-bus-stop commented Mar 7, 2018

Copy link
Copy Markdown
Member

Still need to port:

  • callbackify
  • format
  • inspect
  • isDeepStrictEqual

@goto-bus-stop

Copy link
Copy Markdown
Member Author

The new inspect() function is significantly bigger which is unfortunate. Hopefully common-shakeify can usually remove it from browser builds.

@goto-bus-stop

goto-bus-stop commented Mar 7, 2018

Copy link
Copy Markdown
Member Author

Think I'll split this up so we can get promisify out the door first :P not that many people really need the new format features, probably!

@eemeli

eemeli commented Feb 1, 2019

Copy link
Copy Markdown

How could I help get at least the util.inspect part of this available on npm? I'd like to use it in eemeli/yaml-playground. Brief testing would suggest that it mostly works, except for indentation depth with Map and Set objects.

@BridgeAR

BridgeAR commented May 6, 2019

Copy link
Copy Markdown
Member

What's the status here?

@BridgeAR

Copy link
Copy Markdown
Member

Ping @goto-bus-stop

@goto-bus-stop

Copy link
Copy Markdown
Member Author

promisify/callbackify was landed separately, debuglog is in another PR. Maybe we can extract the inspect progress from this as a separate PR too, but it may be tricky to reconcile the current master with this PR and with the latest Node.js implementation. No work happened here since the last visible changes.

I can't commit enough time to finish inspect in the near future

Comment thread util.js
return debugs[set];
};

var customInspectSymbol = typeof Symbol !== 'undefined' ? Symbol('util.inspect.custom') : undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node 10.12 and newer registers the util.inspect.custom symbol as nodejs.util.inspect.custom, making it possible to use Symbol.for('nodejs.util.inspect.custom') to get the equivalent util.inspect.custom symbol without depending on util:

Suggested change
var customInspectSymbol = typeof Symbol !== 'undefined' ? Symbol('util.inspect.custom') : undefined;
var customInspectSymbol = typeof Symbol !== 'undefined' && typeof Symbol.for !== 'undefined' ? Symbol.for('nodejs.util.inspect.custom') : undefined;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Browsers, however, don’t register it, so I’d you don’t have util.inspect, there’s no point in having the symbol - why not just depend on util?

@ljharb ljharb Feb 2, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, node 6.6-10.11 all require this code, and can’t rely on the shared symbol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants